import traceback

from langchain_core.tools import Tool

from agents.agent import Agent
from simulators.mumu_control import MuMuControl
from ui_engine.le_tools import tools, start_app
from ui_engine.le_ui import LeUi
from tkinter import messagebox

from utils.utils import CommonUtils

if __name__ == '__main__':
    #
    mm = MuMuControl(hide=True)
    try:
        lu = LeUi(simulator_control=mm)
        lu.show()
    except:
        messagebox.showerror("Error", traceback.format_exc())

    # agent = Agent(tools=tools)
    # agent.draw_graph_png()
    #
    # while True:
    #     msg = input("请输入：")
    #     for event in agent.stream(msg):
    #         if "messages" in event:
    #             event["messages"][-1].pretty_print()